﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Collections;
using UMC.Web;
using UMC.WorkFlow.Entities;
using UMC.Data;

namespace UMC.WorkFlow
{

    class TaskFormGridDialog : UIGridDialog
    {
        protected override Hashtable GetHeader()
        {
            var header = new Header("TaskId", 25);
            header.AddField("Caption", "流程名称");
            header.AddField("Code", "流程代码");
            return header.GetHeader();

        }
        protected override Hashtable GetData(IDictionary paramsKey)
        {
            var start = UMC.Data.Utility.Parse((paramsKey["start"] ?? "0").ToString(), 0);
            var limit = UMC.Data.Utility.Parse((paramsKey["limit"] ?? "15").ToString(), 15);

            var c = HotCache.Find(new TaskForm(), false, 0, 10000, out var _);

            var hash = new Hashtable();
            hash["data"] = c;//entity.Query(start, limit);
            hash["total"] = c.Length;// entity.Count();
            if (c.Length == 0)
            {
                hash["msg"] = "未有流程，请新建";
            }
            return hash;
        }
    }

}